/*
 * Texture.cpp
 *
 *  Created on: 12-05-2013
 *      Author: Jarek
 */

#include "ETexture.h"

Texture::Texture() :
	handle				(0),
	textureWidth		(0),
	textureHeight		(0),
	imageWidth			(0),
	imageHeight			(0),
	data				(NULL),
	name				(NULL),
	imageType			(IMAGE_TYPE_UNDEFINED)
{

}

Texture::~Texture()
{
	glDeleteTextures(1, &handle);
	DELETE_ARRAY(data);
	DELETE_ARRAY(name);
}

GLenum Texture::getGLPixelFormat()
{
	switch (imageType)
	{
		case IMAGE_TYPE_RGBA:
			return GL_RGBA;
		case IMAGE_TYPE_RGB:
			return GL_RGB;
		default:
			assert(false);
			return GL_RGBA;
	}
}

